Skip to content

[AI Generated] perf(ntttcp): run ntttcp/lagscope over internal IPv4 on dual-stack (use_ipv6) - #4601

Open
LiliDeng wants to merge 4 commits into
microsoft:mainfrom
LiliDeng:feature/ntttcp-perf-ipv4-in-ipv6
Open

[AI Generated] perf(ntttcp): run ntttcp/lagscope over internal IPv4 on dual-stack (use_ipv6)#4601
LiliDeng wants to merge 4 commits into
microsoft:mainfrom
LiliDeng:feature/ntttcp-perf-ipv4-in-ipv6

Conversation

@LiliDeng

Copy link
Copy Markdown
Collaborator

Problem

perf_tcp_ntttcp_sriov (and the other perf_*_ntttcp_* cases) fail on every
attempt when the environment is deployed with IPv6 (use_ipv6: true):

Error during ntttcp test for 1 connections: no port opened for lagscope server
...
LisaException: ntttcp test for 1 connections failed after 20 attempts.

Root cause: ntttcp and lagscope bind/connect over IPv4 only. On a dual-stack
(use_ipv6) deployment server.internal_address is the IPv6 private address, so
lagscope -r<ipv6> never opens its listening port and every ntttcp attempt
fails. The nodes still have an internal IPv4 on the same (SRIOV) NIC.

Fix

Resolve the server's internal IPv4 from its primary NIC and use it as the
ntttcp/lagscope target when internal_address is IPv6. IPv4-only deployments are
unaffected — internal_address is already IPv4, so the helper returns it
unchanged and every call site behaves exactly as before.

Validation

perf_tcp_ntttcp_sriov on Azure (eastus2, Ubuntu 22.04, Standard_D2ads_v5,
2 nodes, SRIOV):

  • IPv6 deploy + IPv4 ntttcp (use_ipv6: true): PASSED. Logs show
    lagscope -r10.0.0.4TCP 10.0.0.4:6001 (LISTEN) and ntttcp -s10.0.0.4;
    throughput collected (e.g. 3.77 Gbps @ 20480 connections). The VM is dual-stack
    (inet 10.0.0.5, inet6 2001:db8::5).
  • IPv4 (use_ipv6: false): unchanged code path (server_comm_address == server.internal_address), no regression.

Lint

black --check, flake8, pylint (10.00/10) clean on the changed file; mypy
only reports the pre-existing retry import-untyped and unrelated type: ignore
notes.

Copilot AI review requested due to automatic review settings July 16, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses consistent failures in perf_*_ntttcp_* runs on dual-stack (use_ipv6: true) environments by ensuring ntttcp/lagscope target an internal IPv4 address when server.internal_address is an IPv6 address.

Changes:

  • Added an internal helper to resolve an IPv4 address for ntttcp/lagscope when the node’s internal_address is IPv6.
  • Updated perf_ntttcp() to use the resolved IPv4 address for lagscope and ntttcp client/server targeting.

Comment thread lisa/microsoft/testsuites/performance/common.py Outdated
Comment thread lisa/microsoft/testsuites/performance/common.py Outdated
@LiliDeng LiliDeng changed the title perf(ntttcp): run ntttcp/lagscope over internal IPv4 on dual-stack (use_ipv6) [AI Generated] perf(ntttcp): run ntttcp/lagscope over internal IPv4 on dual-stack (use_ipv6) Jul 16, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 01:20
@LiliDeng
LiliDeng force-pushed the feature/ntttcp-perf-ipv4-in-ipv6 branch from a25003e to 4ed2e25 Compare July 17, 2026 01:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/performance/common.py Outdated
@LiliDeng LiliDeng closed this Jul 17, 2026
@LiliDeng LiliDeng reopened this Jul 17, 2026
ntttcp and lagscope bind/connect over IPv4 only. On use_ipv6 (dual-stack) environments server.internal_address is the IPv6 private address, so lagscope fails with 'no port opened for lagscope server' and every ntttcp perf attempt fails. Resolve the server's internal IPv4 from its primary NIC and use it as the ntttcp/lagscope target, so perf runs succeed even when the VMs are deployed with IPv6. IPv4-only deployments are unaffected (internal_address is already IPv4).
Copilot AI review requested due to automatic review settings July 17, 2026 01:27
@LiliDeng
LiliDeng force-pushed the feature/ntttcp-perf-ipv4-in-ipv6 branch from 4ed2e25 to d62b58e Compare July 17, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread lisa/microsoft/testsuites/performance/common.py Outdated
Comment thread lisa/microsoft/testsuites/performance/common.py
notifier.notify(pps_message)


def _get_ntttcp_ipv4_address(node: RemoteNode) -> str:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this function be made generic (removing ntttcp from the name)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

is_ipv6 = False
if not is_ipv6:
return address
ipv4_address = node.nics.get_primary_nic().ip_addr

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if ip_addr is empty? Can we raise an exception when it's empty?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Move the dual-stack IPv4 fallback helper out of the ntttcp perf module and
into Nics as a reusable get_internal_ipv4_address(): prefer the node's
internal_address, fall back to the primary NIC's IPv4 when it is IPv6, and
raise if the NIC has no IPv4 to fall back to.
Copilot AI review requested due to automatic review settings July 27, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread lisa/nic.py
Comment thread lisa/microsoft/testsuites/performance/common.py
Apply the Nics.get_internal_ipv4_address() fallback to every perf tool that
builds IPv4-style CLI args with no IPv6 bracket handling, so they work on
dual-stack (use_ipv6) environments where internal_address is IPv6:
lagscope (perf_tcp_latency), netperf (perf_tcp_pps), iperf3 (perf_iperf),
and sockperf (perf_sockperf).
Copilot AI review requested due to automatic review settings July 28, 2026 03:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread lisa/nic.py Outdated
Comment thread lisa/microsoft/testsuites/performance/common.py
get_internal_ipv4_address() now reads internal_address via getattr so it
never raises AttributeError on nodes without it (e.g. LocalNode); it prefers
internal_address only when it's a valid IPv4 and otherwise falls back to the
primary NIC IPv4 (raising if none). Also assert on the netperf interface_ip
variables directly in perf_tcp_pps.
Copilot AI review requested due to automatic review settings July 28, 2026 04:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

lisa/microsoft/testsuites/performance/common.py:805

  • Minor: avoid bare assert here. Python can run with optimizations (-O) that strip assert statements, which would silently skip these checks. This file already uses assert_that(), so prefer that for consistent, always-on validation.
    if run_with_internal_address:
        server_interface_ip = server_comm_ip
        client_interface_ip = client.nics.get_internal_ipv4_address()
        assert server_interface_ip, "Server Node: internal address is not set"
        assert client_interface_ip, "Client Node: internal address is not set"

Comment thread lisa/nic.py
Comment on lines +291 to +297
ipv4_address: str = self.get_primary_nic().ip_addr
if not ipv4_address:
raise LisaException(
f"internal address '{address}' is not a usable IPv4 and the "
f"primary NIC '{self.get_primary_nic().name}' has no IPv4 "
f"address to fall back to."
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants